<?php

if( ! defined('DOCROOT') )
{
    require_once '/var/www/advancelab/chilik2/unittest/bootstrap.php';
}

class ResultCookieTest extends UnitTestCase
{
    function testingResultCookieTest()
    {
        $struct = new Entity\ResultCookie();
        
        $this->assertIdentical($struct,new Entity\ResultCookie);
        $this->assertTrue($struct instanceof Entity\ResultCookie);
        
        $struct->name = 'php';
        $this->assertEqual( 'php', $struct->name );
        $struct->value = 'ezc';
        $this->assertEqual( 'ezc', $struct->value );
        $struct->expire = 'ezp';
        $this->assertEqual( 'ezp', $struct->expire );
        $struct->path = 'buddymiles';
        $this->assertEqual( 'buddymiles', $struct->path );
        $struct->domain = 'buddyguy';
        $this->assertEqual( 'buddyguy', $struct->domain );
        $struct->secure = 'django';
        $this->assertEqual( 'django', $struct->secure );
        $struct->httpOnly = 'satchmo';
        $this->assertEqual( 'satchmo', $struct->httpOnly );
        
        /* $this->dump($struct); */
    }
    
    public function testMockingMethod()
    {
        $date = new DateTime();
        
        $state = array(
        'name' => 'php',
        'value' => 'ezc',
        'expire' => $date,
        'path' => 'buddymiles',
        'domain' => 'buddyguy',
        'secure' => 'django',
        'httpOnly' => 'satchmo',
        );
        
        $struct = Entity\ResultCookie::__mock( $state );
        
        $this->assertEqual( 'php', $struct->name );
        $this->assertEqual( 'ezc', $struct->value );
        $this->assertEqual( $date, $struct->expire );
        $this->assertEqual( 'buddymiles', $struct->path );
        $this->assertEqual( 'buddyguy', $struct->domain );
        $this->assertEqual( 'django', $struct->secure );
        $this->assertEqual( 'satchmo', $struct->httpOnly );
    }
    
}
